package com.ruoyi.project.config.resources.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.config.resources.mapper.ResourcesConfigMapper;
import com.ruoyi.project.config.resources.domain.ResourcesConfig;
import com.ruoyi.project.config.resources.service.IResourcesConfigService;

/**
 * 资源配置Service业务层处理
 * 
 * @author wyh
 * @date 2024-06-17
 */
@Service
public class ResourcesConfigServiceImpl implements IResourcesConfigService 
{
    @Autowired
    private ResourcesConfigMapper resourcesConfigMapper;

    /**
     * 查询资源配置
     * 
     * @param id 资源配置主键
     * @return 资源配置
     */
    @Override
    public ResourcesConfig selectResourcesConfigById(Long id)
    {
        return resourcesConfigMapper.selectResourcesConfigById(id);
    }

    /**
     * 查询资源配置列表
     * 
     * @param resourcesConfig 资源配置
     * @return 资源配置
     */
    @Override
    public List<ResourcesConfig> selectResourcesConfigList(ResourcesConfig resourcesConfig)
    {
        return resourcesConfigMapper.selectResourcesConfigList(resourcesConfig);
    }

    /**
     * 新增资源配置
     * 
     * @param resourcesConfig 资源配置
     * @return 结果
     */
    @Override
    public int insertResourcesConfig(ResourcesConfig resourcesConfig)
    {
        resourcesConfig.setCreateTime(DateUtils.getNowDate());
        return resourcesConfigMapper.insertResourcesConfig(resourcesConfig);
    }

    /**
     * 修改资源配置
     * 
     * @param resourcesConfig 资源配置
     * @return 结果
     */
    @Override
    public int updateResourcesConfig(ResourcesConfig resourcesConfig)
    {
        resourcesConfig.setUpdateTime(DateUtils.getNowDate());
        return resourcesConfigMapper.updateResourcesConfig(resourcesConfig);
    }

    /**
     * 批量删除资源配置
     * 
     * @param ids 需要删除的资源配置主键
     * @return 结果
     */
    @Override
    public int deleteResourcesConfigByIds(Long[] ids)
    {
        return resourcesConfigMapper.deleteResourcesConfigByIds(ids);
    }

    /**
     * 删除资源配置信息
     * 
     * @param id 资源配置主键
     * @return 结果
     */
    @Override
    public int deleteResourcesConfigById(Long id)
    {
        return resourcesConfigMapper.deleteResourcesConfigById(id);
    }
}
